package com.jinghao.tws.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jinghao.core.common.controller.JingHaoBaseController;
import com.jinghao.tws.entity.WvCloudAccessConfig;
import com.jinghao.tws.service.IWvCloudAccessConfigService;

@Controller
@Scope("prototype")
@RequestMapping(value = "/app/tws/WvCloudAccessConfig")
public class WvCloudAccessConfigController extends JingHaoBaseController<WvCloudAccessConfig> {
	//==================定制内容开始======================
//在这里修改代码
	/**
	 * 查询所有连接配置信息
	 * @param  
	 */
	@ResponseBody
	@RequestMapping(value = "/getWvCloudAccessConfig",method = RequestMethod.GET) 
	public Map<String, Object> getWvCloudAccessConfig(@ModelAttribute("model") WvCloudAccessConfig model){
		this.getWvCloudAccessConfigService().getWvCloudAccessConfig(model);
        return model.getSingleJson();   
	} 
	
	/**
	 * 增加连接配置信息
	 * @param  
	 */
	@ResponseBody
	@RequestMapping(value = "/addWvCloudAccessConfig",method = RequestMethod.POST) 
	public Map<String, Object> addWvCloudAccessConfig(@ModelAttribute("model") WvCloudAccessConfig model){
		this.getWvCloudAccessConfigService().addWvCloudAccessConfig(model);
        return model.getJson();   
	} 
	//==================定制内容结束======================

	@Autowired
	public void setWvCloudAccessConfigService(IWvCloudAccessConfigService wvCloudAccessConfigService) {
		super.setIJingHaoBaseService(wvCloudAccessConfigService);
	}

	public IWvCloudAccessConfigService getWvCloudAccessConfigService() {
		return (IWvCloudAccessConfigService) super.getIJingHaoBaseService();
	}
}
